home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 8741 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  811 b 

  1. Path: news.uh.edu!usenet
  2. From: Sensarn <txs53132@bayou.uh.edu>
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: QUESTION:Random Numbers, etc
  5. Date: 26 Feb 1996 00:57:32 GMT
  6. Organization: AEtna Insurance Agency
  7. Message-ID: <4gr0hs$qck@masala.cc.uh.edu>
  8. References: <4gnpic$j5s@news1.usa.pipeline.com>
  9. NNTP-Posting-Host: sip-14149.public-dialups.uh.edu
  10. Mime-Version: 1.0
  11. Content-Type: text/plain; charset=us-ascii
  12. Content-Transfer-Encoding: 7bit
  13. X-Mailer: Mozilla 1.1 (Windows; U; 16bit)
  14.  
  15. The actual BASIC formula (figured this one out myself) is:
  16.  
  17. INT(RND*(MAX-MIN+1)+MIN)
  18.  
  19. The TC++ 3.1 function random() can be used to generate a similar effect:
  20.  
  21. random(max-min+1)+min;
  22.  
  23. Hope VC++ has random()!
  24.  
  25. -- 
  26. |\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\|
  27. Steven Sensarn -- txs53132@bayou.uh.edu
  28. |/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/|
  29.  
  30.  
  31.